﻿#region Includes
using System;
using OpenTK;
#endregion

namespace GingerGL.Graphics.Models.BSP
{
    //------------------------------------------------------------//
    /// <summary>
    /// BSP Collision Information
    /// </summary>
    public class Collision
    {
        //--------------------------------------------------------//
        #region Properties
        /// <summary>
        /// Gets/Sets TRUE if the line segment is completely enclosed in a solid volume.
        /// </summary>
        public bool AllSolid { get; set; }
        /// <summary>
        /// Gets/Sets The point of collision, in world space
        /// </summary>
        public Vector3 EndPoint { get; set; }
        /// <summary>
        /// Gets/Sets How far along the line we got before we collided. 0.5 == 50%, 1.0 == 100%
        /// </summary>
        public float Fraction { get; set; }
        /// <summary>
        /// Gets/Sets TRUE if the line segment starts outside of a solid volume
        /// </summary>
        public bool StartsOut { get; set; }

        public Vector3 Normal { get; set; }
        public float PlaneDistance { get; set; }
        #endregion
        //--------------------------------------------------------//
        #region Constructors
        /// <summary>
        /// Initalizes a new instance of object
        /// </summary>
        public Collision()
        {
            this.AllSolid = false;
            this.EndPoint = new Vector3();
            this.Fraction = 1f;
            this.Normal = new Vector3();
            this.PlaneDistance = 0f;
            this.StartsOut = true;
        }
        #endregion
        //--------------------------------------------------------//
    }
    //------------------------------------------------------------//
}
